import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './styles/iconfont.css'
import './styles/icon/iconfont.css'
import './styles/iconfont/iconfont.css'
import './styles/icon/font.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css
import { i18n } from './lang'
import '@/components/index.js'
import App from './App'
import store from './store'
import router from './router'
import ContentAttachment from './components/contentAttachment/cateTree.vue'
import OnlineEditor from './components/aceEditor/editor.vue'
import './assets/js/directive' // 拖拽弹窗，在需要用到拖拽功能的弹窗标签上加v-dialogDrag

import '@/icons' // icon
// import '@/permission' // permission control

import elTableInfiniteScroll from 'el-table-infinite-scroll'
import VueClipboard from 'vue-clipboard2'
import uploader from 'vue-simple-uploader'
import md5 from 'md5'
import HuocmsFcDesigner from './components/designer'
import Avue from '@smallwei/avue'
import '@smallwei/avue/lib/index.css'
import VueDragResize from 'vue-drag-resize'
import directives from './directives/index.js'
// import JSEncrypt from 'jsencrypt' // 引入加密模块 改为全局引入
import lodash from 'lodash'

Vue.prototype.$lodash = lodash
Vue.prototype.$jsEncrypt = JSEncrypt // 配置加密模块全局变量
Vue.use(uploader)
Vue.use(elTableInfiniteScroll)
Vue.use(VueClipboard)
Vue.use(md5)
Vue.use(HuocmsFcDesigner)
Vue.use(Avue)
Vue.component('VueDragResize', VueDragResize)
Vue.use(directives)
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
Vue.component('ContentAttachment', ContentAttachment)
Vue.component('OnlineEditor', OnlineEditor)

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)
// set ElementUI lang to EN
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value) // 这里会根据选的语言切换Element-ui的语言
})
Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  // bus,
  render: h => h(App)
})
